package pers.vinsonws.jianghu.serverspring.tools;

import pers.vinsonws.jianghu.serverspring.entity.ChatRooms;
import pers.vinsonws.jianghu.serverspring.entity.Users;
import pers.vinsonws.jianghu.util.ChatRoom;
import pers.vinsonws.jianghu.util.User;

/**
 * @auther vinsonws
 * @date 2018/11/4 22:54
 */
public class Transition {
    public static User fromUsersToUser(Users users, User user){
        user.setId(users.getId());
        user.setAuthorityCode(users.getAuthorityCode());
        user.setUid(users.getUid());
        user.setUserName(users.getUserName());
        user.setPassword(users.getPassword());
        //set
        //我决定将user有多少chatroom单独理出来
        return user;
    }

    public static ChatRoom fromChatRoomsToChatRoom(ChatRooms chatRooms, ChatRoom chatRoom, User master){
        chatRoom.setId(chatRooms.getId());
        chatRoom.setMaster(master);
        chatRoom.setName(chatRooms.getName());
        //set没写
        //我决定将chatroom有多少user单独理出来
        return chatRoom;
    }


}
